package com.wyvoid.forum.web.tag;

import com.wyvoid.forum.web.MyActionBeanContext;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * User: cjp
 * Date: 2007-7-3
 * Time: 21:16:48
 */
public class SecureUserTag extends TagSupport {
    public int doStartTag() throws JspException {
        MyActionBeanContext myActionBeanContext = new MyActionBeanContext((HttpServletRequest)pageContext.getRequest(),(HttpServletResponse)pageContext.getResponse());
        if (myActionBeanContext.isUserLoggedIn()) {
            return EVAL_BODY_INCLUDE;
        } else {
            return SKIP_BODY;
        }
    }
}
